import java.util.ArrayList;
import java.util.List;

//演示用户线程和守护线程
public class Main {

    //public static void main(String[] args) {
    //    Thread aa = new Thread(() -> {
    //        System.out.println(Thread.currentThread().getName() + "::" + Thread.currentThread().isDaemon());
    //        while (true) {
    //
    //        }
    //    }, "aa");
    //    //设置守护线程
    //    aa.setDaemon(true);
    //    aa.start();
    //
    //    System.out.println(Thread.currentThread().getName()+" over");
    //}


    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        for (int i = 1; i <= 2; i++) {
            list.add(i);
        }

        int batchSize = 10;
        int totalBatches = (list.size() + batchSize - 1) / batchSize;

        for (int i = 0; i < totalBatches; i++) {
            int startIndex = i * batchSize;
            int endIndex = Math.min(startIndex + batchSize, list.size());
            List<Integer> subList = list.subList(startIndex, endIndex);
            System.out.println("批次 " + (i + 1) + ": " + subList);
        }
    }

}
